import request from '@/utils/request'

// 查询短信客户信息列表
export function listContactCustomer(query) {
  return request({
    url: '/Sms/contactCustomer/list',
    method: 'get',
    params: query
  })
}

// 查询短信客户信息详细
export function getContactCustomer(customerId) {
  return request({
    url: '/Sms/contactCustomer/' + customerId,
    method: 'get'
  })
}

// 新增短信客户信息
export function addContactCustomer(data) {
  return request({
    url: '/Sms/contactCustomer',
    method: 'post',
    data: data
  })
}

// 修改短信客户信息
export function updateContactCustomer(data) {
  return request({
    url: '/Sms/contactCustomer',
    method: 'put',
    data: data
  })
}

// 删除短信客户信息
export function delContactCustomer(customerIds) {
  return request({
    url: '/Sms/contactCustomer/' + customerIds,
    method: 'delete'
  })
}

// 导出短信客户信息
export function exportContactCustomer(query) {
  return request({
    url: '/Sms/contactCustomer/export',
    method: 'post',
    params: query
  })
}

// 批量更新客户分组
export function batchUpdateCustomerGroup(data) {
  return request({
    url: '/Sms/contactCustomer/batchUpdateGroup',
    method: 'put',
    data: data
  })
}

// 搜索客户
export function searchCustomers(keyword) {
  return request({
    url: '/Sms/contactCustomer/search',
    method: 'get',
    params: { keyword }
  })
}

// 检查手机号是否唯一
export function checkPhoneUnique(data) {
  return request({
    url: '/Sms/contactCustomer/checkPhoneUnique',
    method: 'get',
    params: data
  })
}

// 批量导入客户信息
export function importContactCustomer(data) {
  return request({
    url: '/Sms/contactCustomer/import',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 下载导入模板
export function downloadImportTemplate() {
  return request({
    url: '/Sms/contactCustomer/importTemplate',
    method: 'get',
    responseType: 'blob'
  })
} 